Optimal. Leaf size=519 \[ 4 a b n x-8 b^2 n^2 x+4 b n (a-b n) x-\frac {4 b n (a-b n) \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}+8 b^2 n x \log \left (c x^n\right )-\frac {4 b^2 n \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right ) \log \left (c x^n\right )}{\sqrt {d} \sqrt {f}}-2 x \left (a+b \log \left (c x^n\right )\right )^2-\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )+\frac {2 b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}-\frac {2 b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {2 i b^2 n^2 \text {Li}_2\left (-i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {2 i b^2 n^2 \text {Li}_2\left (i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {2 b^2 n^2 \text {Li}_3\left (-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {2 b^2 n^2 \text {Li}_3\left (\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.55, antiderivative size = 519, normalized size of antiderivative = 1.00, number of steps
used = 26, number of rules used = 16, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.640, Rules used = {2333,
2332, 2418, 6, 327, 209, 2393, 2361, 12, 4940, 2438, 2395, 2367, 2354, 2421, 6724}
\begin {gather*} \frac {2 b n \text {PolyLog}\left (2,-\sqrt {-d} \sqrt {f} x\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {-d} \sqrt {f}}-\frac {2 b n \text {PolyLog}\left (2,\sqrt {-d} \sqrt {f} x\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {-d} \sqrt {f}}+\frac {2 i b^2 n^2 \text {PolyLog}\left (2,-i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {2 i b^2 n^2 \text {PolyLog}\left (2,i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {2 b^2 n^2 \text {PolyLog}\left (3,-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {2 b^2 n^2 \text {PolyLog}\left (3,\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}-\frac {4 b n (a-b n) \text {ArcTan}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {\log \left (1-\sqrt {-d} \sqrt {f} x\right ) \left (a+b \log \left (c x^n\right )\right )^2}{\sqrt {-d} \sqrt {f}}+\frac {\log \left (\sqrt {-d} \sqrt {f} x+1\right ) \left (a+b \log \left (c x^n\right )\right )^2}{\sqrt {-d} \sqrt {f}}+x \log \left (d f x^2+1\right ) \left (a+b \log \left (c x^n\right )\right )^2-2 x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x \log \left (d f x^2+1\right )+4 a b n x+4 b n x (a-b n)-\frac {4 b^2 n \text {ArcTan}\left (\sqrt {d} \sqrt {f} x\right ) \log \left (c x^n\right )}{\sqrt {d} \sqrt {f}}-2 b^2 n x \log \left (c x^n\right ) \log \left (d f x^2+1\right )+8 b^2 n x \log \left (c x^n\right )+2 b^2 n^2 x \log \left (d f x^2+1\right )-8 b^2 n^2 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 6
Rule 12
Rule 209
Rule 327
Rule 2332
Rule 2333
Rule 2354
Rule 2361
Rule 2367
Rule 2393
Rule 2395
Rule 2418
Rule 2421
Rule 2438
Rule 4940
Rule 6724
Rubi steps
\begin {align*} \int \left (a+b \log \left (c x^n\right )\right )^2 \log \left (d \left (\frac {1}{d}+f x^2\right )\right ) \, dx &=-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )-(2 f) \int \left (-\frac {2 a b d n x^2}{1+d f x^2}+\frac {2 b^2 d n^2 x^2}{1+d f x^2}-\frac {2 b^2 d n x^2 \log \left (c x^n\right )}{1+d f x^2}+\frac {d x^2 \left (a+b \log \left (c x^n\right )\right )^2}{1+d f x^2}\right ) \, dx\\ &=-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )-(2 f) \int \left (\frac {d \left (-2 a b n+2 b^2 n^2\right ) x^2}{1+d f x^2}-\frac {2 b^2 d n x^2 \log \left (c x^n\right )}{1+d f x^2}+\frac {d x^2 \left (a+b \log \left (c x^n\right )\right )^2}{1+d f x^2}\right ) \, dx\\ &=-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )-(2 d f) \int \frac {x^2 \left (a+b \log \left (c x^n\right )\right )^2}{1+d f x^2} \, dx+\left (4 b^2 d f n\right ) \int \frac {x^2 \log \left (c x^n\right )}{1+d f x^2} \, dx+(4 b d f n (a-b n)) \int \frac {x^2}{1+d f x^2} \, dx\\ &=4 b n (a-b n) x-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )-(2 d f) \int \left (\frac {\left (a+b \log \left (c x^n\right )\right )^2}{d f}-\frac {\left (a+b \log \left (c x^n\right )\right )^2}{d f \left (1+d f x^2\right )}\right ) \, dx+\left (4 b^2 d f n\right ) \int \left (\frac {\log \left (c x^n\right )}{d f}-\frac {\log \left (c x^n\right )}{d f \left (1+d f x^2\right )}\right ) \, dx-(4 b n (a-b n)) \int \frac {1}{1+d f x^2} \, dx\\ &=4 b n (a-b n) x-\frac {4 b n (a-b n) \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )-2 \int \left (a+b \log \left (c x^n\right )\right )^2 \, dx+2 \int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{1+d f x^2} \, dx+\left (4 b^2 n\right ) \int \log \left (c x^n\right ) \, dx-\left (4 b^2 n\right ) \int \frac {\log \left (c x^n\right )}{1+d f x^2} \, dx\\ &=-4 b^2 n^2 x+4 b n (a-b n) x-\frac {4 b n (a-b n) \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}+4 b^2 n x \log \left (c x^n\right )-\frac {4 b^2 n \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right ) \log \left (c x^n\right )}{\sqrt {d} \sqrt {f}}-2 x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )+2 \int \left (\frac {\left (a+b \log \left (c x^n\right )\right )^2}{2 \left (1-\sqrt {-d} \sqrt {f} x\right )}+\frac {\left (a+b \log \left (c x^n\right )\right )^2}{2 \left (1+\sqrt {-d} \sqrt {f} x\right )}\right ) \, dx+(4 b n) \int \left (a+b \log \left (c x^n\right )\right ) \, dx+\left (4 b^2 n^2\right ) \int \frac {\tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f} x} \, dx\\ &=4 a b n x-4 b^2 n^2 x+4 b n (a-b n) x-\frac {4 b n (a-b n) \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}+4 b^2 n x \log \left (c x^n\right )-\frac {4 b^2 n \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right ) \log \left (c x^n\right )}{\sqrt {d} \sqrt {f}}-2 x \left (a+b \log \left (c x^n\right )\right )^2-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )+\left (4 b^2 n\right ) \int \log \left (c x^n\right ) \, dx+\frac {\left (4 b^2 n^2\right ) \int \frac {\tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{x} \, dx}{\sqrt {d} \sqrt {f}}+\int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{1-\sqrt {-d} \sqrt {f} x} \, dx+\int \frac {\left (a+b \log \left (c x^n\right )\right )^2}{1+\sqrt {-d} \sqrt {f} x} \, dx\\ &=4 a b n x-8 b^2 n^2 x+4 b n (a-b n) x-\frac {4 b n (a-b n) \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}+8 b^2 n x \log \left (c x^n\right )-\frac {4 b^2 n \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right ) \log \left (c x^n\right )}{\sqrt {d} \sqrt {f}}-2 x \left (a+b \log \left (c x^n\right )\right )^2-\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )+\frac {(2 b n) \int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1-\sqrt {-d} \sqrt {f} x\right )}{x} \, dx}{\sqrt {-d} \sqrt {f}}-\frac {(2 b n) \int \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\sqrt {-d} \sqrt {f} x\right )}{x} \, dx}{\sqrt {-d} \sqrt {f}}+\frac {\left (2 i b^2 n^2\right ) \int \frac {\log \left (1-i \sqrt {d} \sqrt {f} x\right )}{x} \, dx}{\sqrt {d} \sqrt {f}}-\frac {\left (2 i b^2 n^2\right ) \int \frac {\log \left (1+i \sqrt {d} \sqrt {f} x\right )}{x} \, dx}{\sqrt {d} \sqrt {f}}\\ &=4 a b n x-8 b^2 n^2 x+4 b n (a-b n) x-\frac {4 b n (a-b n) \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}+8 b^2 n x \log \left (c x^n\right )-\frac {4 b^2 n \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right ) \log \left (c x^n\right )}{\sqrt {d} \sqrt {f}}-2 x \left (a+b \log \left (c x^n\right )\right )^2-\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )+\frac {2 b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}-\frac {2 b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {2 i b^2 n^2 \text {Li}_2\left (-i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {2 i b^2 n^2 \text {Li}_2\left (i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {\left (2 b^2 n^2\right ) \int \frac {\text {Li}_2\left (-\sqrt {-d} \sqrt {f} x\right )}{x} \, dx}{\sqrt {-d} \sqrt {f}}+\frac {\left (2 b^2 n^2\right ) \int \frac {\text {Li}_2\left (\sqrt {-d} \sqrt {f} x\right )}{x} \, dx}{\sqrt {-d} \sqrt {f}}\\ &=4 a b n x-8 b^2 n^2 x+4 b n (a-b n) x-\frac {4 b n (a-b n) \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}+8 b^2 n x \log \left (c x^n\right )-\frac {4 b^2 n \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right ) \log \left (c x^n\right )}{\sqrt {d} \sqrt {f}}-2 x \left (a+b \log \left (c x^n\right )\right )^2-\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {\left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}-2 a b n x \log \left (1+d f x^2\right )+2 b^2 n^2 x \log \left (1+d f x^2\right )-2 b^2 n x \log \left (c x^n\right ) \log \left (1+d f x^2\right )+x \left (a+b \log \left (c x^n\right )\right )^2 \log \left (1+d f x^2\right )+\frac {2 b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}-\frac {2 b n \left (a+b \log \left (c x^n\right )\right ) \text {Li}_2\left (\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {2 i b^2 n^2 \text {Li}_2\left (-i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {2 i b^2 n^2 \text {Li}_2\left (i \sqrt {d} \sqrt {f} x\right )}{\sqrt {d} \sqrt {f}}-\frac {2 b^2 n^2 \text {Li}_3\left (-\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}+\frac {2 b^2 n^2 \text {Li}_3\left (\sqrt {-d} \sqrt {f} x\right )}{\sqrt {-d} \sqrt {f}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.22, size = 544, normalized size = 1.05 \begin {gather*} \frac {-2 \sqrt {d} \sqrt {f} x \left (a^2-2 a b n+2 b^2 n^2+2 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+2 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right )+2 \tan ^{-1}\left (\sqrt {d} \sqrt {f} x\right ) \left (a^2-2 a b n+2 b^2 n^2+2 b^2 n \left (n \log (x)-\log \left (c x^n\right )\right )+2 a b \left (-n \log (x)+\log \left (c x^n\right )\right )+b^2 \left (-n \log (x)+\log \left (c x^n\right )\right )^2\right )+\sqrt {d} \sqrt {f} x \left (a^2-2 a b n+2 b^2 n^2+2 b (a-b n) \log \left (c x^n\right )+b^2 \log ^2\left (c x^n\right )\right ) \log \left (1+d f x^2\right )+2 b n \left (a-b n-b n \log (x)+b \log \left (c x^n\right )\right ) \left (-2 \sqrt {d} \sqrt {f} x (-1+\log (x))-i \left (\log (x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )+\text {Li}_2\left (-i \sqrt {d} \sqrt {f} x\right )\right )+i \left (\log (x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )+\text {Li}_2\left (i \sqrt {d} \sqrt {f} x\right )\right )\right )-2 b^2 n^2 \left (\sqrt {d} \sqrt {f} x \left (2-2 \log (x)+\log ^2(x)\right )+\frac {1}{2} i \left (\log ^2(x) \log \left (1+i \sqrt {d} \sqrt {f} x\right )+2 \log (x) \text {Li}_2\left (-i \sqrt {d} \sqrt {f} x\right )-2 \text {Li}_3\left (-i \sqrt {d} \sqrt {f} x\right )\right )-\frac {1}{2} i \left (\log ^2(x) \log \left (1-i \sqrt {d} \sqrt {f} x\right )+2 \log (x) \text {Li}_2\left (i \sqrt {d} \sqrt {f} x\right )-2 \text {Li}_3\left (i \sqrt {d} \sqrt {f} x\right )\right )\right )}{\sqrt {d} \sqrt {f}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.01, size = 0, normalized size = 0.00 \[\int \left (a +b \ln \left (c \,x^{n}\right )\right )^{2} \ln \left (d \left (\frac {1}{d}+f \,x^{2}\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \log {\left (c x^{n} \right )}\right )^{2} \log {\left (d f x^{2} + 1 \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \ln \left (d\,\left (f\,x^2+\frac {1}{d}\right )\right )\,{\left (a+b\,\ln \left (c\,x^n\right )\right )}^2 \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________